<template>
  <div>
    <label v-for="menu in menuData">
    <el-submenu :index=menu.index v-if="menu.isContent">
      <template slot="title">
        <i :class=menu.icon></i>
        {{menu.name}}
      </template>
      <tree_menu v-bind:menuData=menu.children></tree_menu>
    </el-submenu>

    <el-menu-item :index=menu.index v-else>
      <i :class=menu.icon></i>
      <span slot="title">{{menu.name}}</span>
    </el-menu-item>
    </label>
  </div>
</template>


<script>
  export default {
    name: 'tree_menu',
    props: {
      menuData: {
        type: Array,
        required: true
      }
    }
  }


</script>


<style scoped>

</style>
